package asteroids.model.programs.parsing.expressions;

public abstract class EntityExpression extends UnaryExpression {

	protected EntityExpression(E expression) {
		super(expression);
		if(!canHaveAsEntityExpression(expression)){
			setExpression(null);
		}
	}
	
	public boolean canHaveAsEntityExpression(E expression){
		return expression.isEntity() || expression.isString();
	}
	
	@Override
	public boolean isDouble(){
		return true;
	}
	public boolean isBoolean(){
		return false;
	}
	public boolean isEntity(){
		return false;
	}
	public boolean isString(){
		return false;
	}
}

